import { Widget, _decorator, Node, tween, v3, Label, Vec2, v2, math, Tween, Component } from 'cc';
import { GameMgr } from '../manager/GameMgr';
import { UIMain } from './UIMain';
import UI from 'db://assets/Script/Manager/UI';

const { ccclass, property, requireComponent } = _decorator;

@ccclass('UI/UIWin')
@requireComponent(Widget)
export class UIWin extends Component {
    ShowOn() {
        this.node.active = true;
        GameMgr.passGame()
    }
    ShowOff() {
        this.node.destroy();
    }

    onBtnNextClick() {
        GameMgr.startGame()
        this.ShowOff()
    }

    onBtnCloseClick() {
        this.ShowOff()
        GameMgr.quitGame()
        // this.open(UI.Main)
        UI.Instance.CreatePanel_sub(`ui`, `UIMain`, UIMain);
    }
}